<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>工程进度款管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../../../resources/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../resources/css/style.css" media="all">
    <style>
        /*.layui-form-pane .layui-input-block{margin-left: 82px;}*/
        .saixuan:after{width: 0;}
        .layui-form-pane .layui-input-block{margin-left: 0;}
        .layui-form-item .layui-input-inline{width: 165px;}
        .masksx .forms{padding-left: 0;text-align: center;}
        .masksx{width: 650px;}
        .mask input{width: 100%!important;}
        .mask .layui-select-title{width: 480px;}
        .layui-inline{margin-bottom: 10px;}
        .layui-upload{ text-align: left;}
        #demo2 img{width: 120px; height: 120px;}
        .imgs{position: relative;width: 120px; height: 120px; float: left;}
        ._ingshan{position: absolute;right: 0px;top: 0px;border: 1px solid #E3e3e3;
            border-radius: 50%;width: 20px;height: 20px;text-align: center;}
        @media only screen and (min-width: 321px) and (max-width: 1024px) {
            .layui-form-pane .layui-form-label{width: 108px;}
            .layui-input-inline{width: 100%;}
            .mask .layui-input-inline{width:auto;}
            .layui-form-item .layui-input-inline{width: 100%;}
        }
        .chakan{display: none;}
        .chakan input{width: 83%!important;}
        .dynamic li:before{content: "";}
        .dynamic{text-align: left;}
        .dynamic li{text-align: center; height: 30px;line-height: 30px;}
        .GLeft{width: 100px;display: inline-block;text-align: right; padding-right: 10px;}
        .masksx{height: 80%;text-align: center;width: 80%;}
        .GLeft,.GRight{width: 45%;display: inline-block;}
        .GRight{text-align: left;width: 45%;}
        .zeng input{width: 40%!important;display: inline-block;}
        .zeng{position: relative; margin-bottom:10px; }
        .zengjia{position: absolute;left: 15px;top: 5px;}
        .shanchu{position: absolute;right: 15px; top: 5px;}
        .neirong{display: none;}
        .neirong input{width: 24%!important;display: inline-block;}
        .layui-form-item .layui-input-inline{width: 100%;}
        .layui-form-item{clear:none;}
        .layui-input-inline{width: 80%!important;}
        li:before{content:'';}
        .layui-tab-title .layui-this{color: #fff;background-color: #009688;}
        .layui-form{height: auto!important;}
        ._Yin{display: none;text-align: right!important;}
        .zJ{text-align: right;}
        .zJ{display: none;}
        .tijiao{width: 80px;}
        .layui-form-pane .layui-form-item[pane]{border: 0;}
    </style>
</head>
<body>
<a class="dayin" type="button" id="dlink"  style="float: right; position: fixed; right: 50px; bottom: 50px; z-index: 999;"></a>
<form class="layui-form layui-form-pane" id="form_7grid" action="" >
    <div class="formTop layui-row">
        <div class="layui-form-item layui-col-lg2 layui-col-sm2 layui-col-xs2">
            <div class="layui-input-inline">
                <input type="text" name="cc_code"  placeholder="项目名称" autocomplete="off" class="layui-input">

            </div>
        </div>
        <div class="layui-form-item layui-col-lg2 layui-col-sm2 layui-col-xs2 dongXian">
            <div class="layui-input-inline">
                <input type="text" name="sbr"  placeholder="施工单位" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline layui-col-lg2 layui-col-sm2 layui-col-xs2">
            <div class="layui-input-inline">
                <input type="text" class="layui-input" id="test-limit3" placeholder="请选择上报开始日期">
                <div class="icons">

                </div>
            </div>
        </div>
        <div class="layui-inline layui-col-lg2 layui-col-sm2 layui-col-xs2">
            <div class="layui-input-inline">
                <input type="text" class="layui-input" id="test-limit4" placeholder="请选择上报结束日期">
                <div class="icons">

                </div>
            </div>
        </div>

        <div class="layui-col-lg3 layui-col-md3 layui-col-xs3 dongTai">
            <button class="layui-btn" type="button" onclick="query()">查询
            </button>
            <button class="layui-btn shenqingvisa quanxian" type="button"  style="background-color:
            #FE913F; margin-left: 30px;" onclick="zhifu()" QX="api/process/addProcessPrice.do">进度款支付</button>
        </div>

    </div>

    <table id="demo" lay-filter="test"></table>


    <script type="text/html" id="barDemo">
        <a class="layui-btn layui-btn-sm quanxian" lay-event="detail"  QX="api/contract/loadContractDetails.do">查看</a>
    </script>


    <div class="mask">
        <div class="masksx">
            <div class="title"><span class="titleL">进度款支付</span><span class="close">×</span></div>
            <div class="forms shenqing">
                <form class="layui-form addUser" method="post" action="">
                    <div class="layui-inline houbu">
                        <label class="layui-form-label">项目名称:</label>
                        <div class="layui-input-inline">
                            <select name="bt_id" lay-verify="required" lay-search="" lay-filter="filter">
                                <option value="">直接选择或搜索选择</option>
                                <!--<option value="1">1</option>-->

                            </select>
                            <input type="hidden" name="compCode1" lay-verify="title" autocomplete="off" placeholder="请输入" class="layui-input">

                        </div>
                    </div>

                    <table class="layui-table dongtab xuanzhong">
                        <thead>
                        <tr>
                            <th>名称</th>
                            <th>数量</th>
                            <th>计量单位</th>
                        </tr>
                        </thead>
                        <tbody>
                        <!--<tr>-->
                        <!--<td></td>-->
                        <!--<td></td>-->
                        <!--<td></td>-->
                        <!--</tr>-->
                        </tbody>
                    </table>
                    <div class="neirong">
                        <!--<input type="text" name="compCode1" disabled="disabled" lay-verify="title" autocomplete="off" placeholder="请输入" class="layui-input">-->
                        <!--<input type="number" name="compCode1" lay-verify="title" autocomplete="off" placeholder="请输入" class="layui-input">-->
                        <!--<input type="text" name="compCode1" disabled="disabled" lay-verify="title" autocomplete="off" placeholder="请输入" class="layui-input">-->
                    </div>

                    <div class="layui-inline layui-col-lg4 layui-col-sm4 layui-col-xs4 _Yin" style="margin-top: 20px;">
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" id="test-limit5" placeholder="请选择上报开始日期">
                            <div class="icons">

                            </div>
                        </div>
                    </div>
                    <div class="layui-inline layui-col-lg4 layui-col-sm4 layui-col-xs4 _Yin" style="margin-top: 20px;">
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" id="test-limit6" placeholder="请选择上报结束日期">
                            <div class="icons">

                            </div>
                        </div>
                    </div>
                    <div class="layui-col-lg4 layui-col-md4 layui-col-xs4 dongTai _Yin" style="margin-top: 20px; text-align: center!important;">
                        <button class="layui-btn" type="button" onclick="querys()">查询
                        </button>
                    </div>

                    <!--<table class="layui-table dongtab2 beixuan _Yin">-->
                        <!--<thead>-->
                        <!--<tr>-->
                            <!--<th style="width:90px;">-->
                                <!--<div class="layui-form-item" pane="" style="width: 90px;">-->
                                    <!--<div class="layui-input-block">-->

                                        <!--<input type="checkbox" name="like1[write]" lay-filter="allChoose" lay-skin="primary" title='选中' class="quanxuan">       &lt;!&ndash;checked=""   是否被选中&ndash;&gt;-->

                                    <!--</div>-->
                                <!--</div>-->
                            <!--</th>-->
                            <!--<th>名称</th>-->
                            <!--<th>单价</th>-->
                            <!--<th>数量</th>-->
                            <!--<th>计量单位</th>-->

                        <!--</tr>-->
                        <!--</thead>-->
                        <!--&lt;!&ndash;<tbody>&ndash;&gt;-->
                            <!--&lt;!&ndash;<tr>&ndash;&gt;-->
                                <!--&lt;!&ndash;<td>1</td>&ndash;&gt;-->
                                <!--&lt;!&ndash;<td>1</td>&ndash;&gt;-->
                                <!--&lt;!&ndash;<td>1</td>&ndash;&gt;-->
                            <!--&lt;!&ndash;</tr>&ndash;&gt;-->
                        <!--&lt;!&ndash;</tbody>&ndash;&gt;-->
                <!--&lt;!&ndash;&ndash;&gt;-->



                    <!--</table>-->
                    <div class="warp" style="clear: both;">
                        <div class="layui-input-block _Yin" style="display: inline-block;float: left;">

                            <input type="checkbox" name="like1[write]" lay-filter="allChoose" lay-skin="primary" title='全选' class="quanxuan">       <!--checked=""   是否被选中-->

                        </div>
                        <div class="zJ">
                            <span class="zuo" style="margin-right: 40px;">总价<strong>0</strong></span>
                        </div>
                        <div class="danhaos _Yin">

                            <!--<table class="layui-table " id="table-1">-->
                            <!--<thead>-->
                            <!--<tr>-->
                            <!--<th>-->
                            <!--<div class="layui-form-item" pane="">-->
                            <!--<div class="layui-input-block">-->
                            <!--<input type="checkbox" name="like1[write]" lay-filter="filter" lay-skin="primary" title=''>-->
                            <!--</div>-->
                            <!--</div>-->
                            <!--</th>-->
                            <!--<th>名称</th>-->
                            <!--<th>数量</th>-->
                            <!--<th>计量单位</th>-->
                            <!--<th>小计</th>-->

                            <!--</tr>-->
                            <!--</thead>-->
                            <!--<tbody>-->
                            <!--<tr>-->
                            <!--<td></td>-->
                            <!--<td>1</td>-->
                            <!--<td>1</td>-->
                            <!--<td>1</td>-->
                            <!--<td>1</td>-->
                            <!--</tr>-->
                            <!--</tbody>-->
                            <!--</table>-->

                        </div>
                    </div>

                    <!--<div class="danhaos _Yin">-->

                        <!--<table class="layui-table " id="2">-->
                            <!--<thead>-->
                            <!--<tr>-->
                                <!--<th>多选</th>-->
                                <!--<th>名称</th>-->
                                <!--<th>数量</th>-->
                                <!--<th>计量单位</th>-->
                                <!--<th>小计</th>-->

                            <!--</tr>-->
                            <!--</thead>-->
                            <!--<tbody>-->
                            <!--<tr>-->
                                <!--<td></td>-->
                                <!--<td>1</td>-->
                                <!--<td>1</td>-->
                                <!--<td>1</td>-->
                                <!--<td>1</td>-->
                            <!--</tr>-->
                            <!--</tbody>-->
                        <!--</table>-->
                    <!--</div>-->


                    <div class="_submit _Yin">
                        <button class="layui-btn layui-btn-sm tijiao" lay-submit lay-filter="_submson" style="margin-right: 15px;">提交</button>

                    </div>
                </form>

            </div>
           <!-- <div class="forms chakan">
                <form class="layui-form addUser" method="post" action="">
                    <ul class="dynamic">
                        <li>
                            <p><span class="GLeft">合同编号:</span><span class="GRight cc_Code">CCD551</span></p>
                        </li>
                        <li>
                            <p><span class="GLeft">项目名称:</span><span class="GRight eppName"></span></p>
                        </li>
                        <li>
                            <p><span class="GLeft">上报时间:</span><span class="GRight createTime"></span></p>
                        </li>
                        <li>
                            <p><span class="GLeft">施工单位:</span><span class="GRight compName1"></span></p>
                        </li>

                    </ul>
                </form>
            </div>
            -->
        </div>
    </div>



</form>

<script src="../../../resources/layui/layui.js" charset="utf-8"></script>
<script src="../../../resources/js/style.js"></script>
<script src="../../../resources/js/api.js"></script>

<script>
    function query() {
        layui.use(['form', 'layedit', 'laydate','table','element','upload'], function() {
            var form = layui.form
                , table = layui.table
                ,upload = layui.upload;
            var pronName=$("[name='cc_code']").val();      //获取查询值
            var begintime=$('#test-limit3').val();          //获取查询开始时间
            var endtime=$('#test-limit4').val();            //获取查询结束时间
            var state=$('[name="state"]').val();         //获取状态值
            var sbr=$('[name="sbr"]').val();

            $('#form_7grid').attr('action',urls+'/api/process/builProcessList.do')
            if(!AntiSqlValid(pronName)){           //判断是否包含特殊符号
                API.gongchengjindukuan({'type':'a','bengintime':begintime,'endtime':endtime,'state':state,'proName':pronName,'compName':sbr,'p':getCookie('yanzheng')})
//                API.progress1({'type':'d','bengintime':begintime,'endtime':endtime,'proName':pronName,'sbr':sbr,'p':getCookie('yanzheng')});

            }else {
                layer.msg('请勿输入特殊符号');
            };
        })


    }
    function zhifu() {
        $('.mask').show();
    }
    function querys() {
        layui.use(['form'], function() {
            var form=layui.form;
            var begintime=$('#test-limit5').val();
            var endtime=$('#test-limit6').val();
            ajaxs('/api/process/buildProcessPriceMana.do','post',{'type':'b','remark': sessionStorage.remark,'begintime':begintime,'endtime':endtime,'p':getCookie('yanzheng')},function (data){
                console.log(data.data,'sadsadasdasdasdasdasdsadas')
                $('.danhaos').html('');
                var data1=data.data;
                var dzj=0;
                var jia=0;
                for(var i=0;i<data1.length;i++){
                    $('.danhaos').append(' <table class="layui-table " id="table-'+i+'" bt_id="'+data1[i].bt_id+'" >\n' +
                        '                            <thead>\n' +
                        '                                   <tr>\n' +
                        '                                    <th> ' +
                        '                                         <div class="layui-form-item" pane="">\n' +
                        '                                            <div class="layui-input-block">\n' +
                        '                                                <input type="checkbox" name="like1[write]" lay-filter="filter" lay-skin="primary" title=\'\'>\n' +
                        '                                            </div>\n' +
                        '                                        </div>' +
                        '                                   </th>\n' +
                        '                                    <th>名称</th>\n' +
                        '                                    <th>数量</th>\n' +
                        '                                    <th>计量单位</th>\n' +
                        '                                    <th>小计</th>\n' +
                        '\n' +
                        '                                </tr>\n' +
                        '                            </thead>\n' +
                        '                            <tbody>\n' +

                        '                            </tbody>\n' +
                        '                        </table>');

                    for(var j=0;j<data1[i].details.length;j++){
                        var dasj=data1[i].details[j];
                        var jia=0;



                        $('#table-'+i).append('<tr>\n' +
                            '                                    <td></td>\n' +
                            '                                    <td>'+dasj.bt_Name+'</td>\n' +
                            '                                    <td>'+dasj.bt_Value+'</td>\n' +
                            '                                    <td>'+dasj.bt_bit+'</td>\n' +
                            '                                    <td>'+jia+'</td>\n' +
                            '                                </tr>')

                    };
                    $('#table-'+i).attr('zj',dzj);
                }


                form.render();
                $('.zJ').show();

            })

        })

    }


    layui.use(['form', 'layedit', 'laydate','table','element','upload'], function(){
        var form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,laydate = layui.laydate
            ,table=layui.table
            ,element=layui.element
            ,upload = layui.upload;

        var canshu=new Object();
        var zongjia=0;
        var idsa='';
        dayintishi('.dayin');
        jiazais();

        //监听全选
        form.on('checkbox(allChoose)', function(data){
            console.log(data.elem); //得到checkbox原始DOM对象
            console.log(data.elem.checked); //是否被选中，true或者false
            console.log(data.value); //复选框value值，也可以通过data.elem.value得到
            console.log(data.othis); //得到美化后的DOM对象

            zongjia=0;
            var child = $(data.elem).parents('.warp').find('.layui-table thead input[type="checkbox"]');
            //找到tbody下的所有多选框
            child.each(function(index, item){                             //循环每个参数item  每个多选框
                item.checked = data.elem.checked;                         //所有多选框  选中或取消选中
                console.log(item)
//                $(item).trigger('click');
            });
            form.render('checkbox');                                      //局部刷新多选框  保持页面操作一致性

//            console.log($('.beixuan').find('tr'), '<=============,,,,,,')

//            $('.beixuan').find('tr').toggleClass('active');
//            isAllChecked($('.beixuan').find('tbody'));
//
            if(data.elem.checked){
                $('.masksx').find('.danhaos').each(function (k,v) {

                    console.log( v, '{=<<<<<<<<<<,,,,,,,,,.......' )

                    $(v).find('.layui-table').each(function (k,v) {
                        var jia=$(v).attr('zj');
                        console.log(v)
                        zongjia+=Number(jia);

                    })


                })
                $('.zJ strong').html(zongjia.toFixed(4)+'(万元)');
            }else{
                $('.zJ strong').html(0);

            }


            return;


        });
        //监听单个点击多选
        form.on('checkbox(filter)', function(data){
            console.log(data.elem); //得到checkbox原始DOM对象
            console.log(data.elem.checked); //是否被选中，true或者false
            console.log(data.value); //复选框value值，也可以通过data.elem.value得到
            console.log(data.othis); //得到美化后的DOM对象
            var as=true;
            zongjia=Number(zongjia);
            if(data.elem.checked){
                var jia=$(data.elem).parents('.layui-table').attr('zj');
                zongjia+=Number(jia)

            }else{
                var jia=$(data.elem).parents('.layui-table').attr('zj');
                zongjia-=Number(jia).toFixed(4);
            }

            $('.zJ strong').html(zongjia.toFixed(4)+'(万元)');

            $('table [name="like1[write]"]').each(function () {
                if(!$(this).is(':checked')){
                    as=false;
                    return false;
                }else{
                    as=true;
                };
            });

            $('.zJ').show();
            var child = $('.quanxuan');
            if(as){
                child[0].checked=true;                       //所有多选框  选中或取消选中

            }else{
                child[0].checked=false;                       //所有多选框  选中或取消选中

            }
            form.render();
            // << create by hsh O.O

//            afterChecked(data.elem);


            form.render();

        });

        API.gongchengjindukuan({'type':'a','p':getCookie('yanzheng')});


        var arrs=getCookie('yanzheng');
        arrs=arrs.split('|')

        ajaxs('/api/public/loadPriDropDown.do','post',{'type':'d','p':getCookie('yanzheng')},function (data) {
            console.log(data)
            var datas=data.data;
            for(var i=0;i<datas.length;i++){

                $('[name="bt_id"]').append('<option value="'+datas[i].cc_UUID+'">'+datas[i].proName+'</option>')
                canshu[datas[i].cc_UUID]={'names':datas[i].eppStaEnd}
            }
            form.render();
        })

        var _picurls=new Array();

        $('.huizhong').click(function () {
            $('.dongXian').hide();
        })
        $('.mingxi').click(function () {
            $('.dongXian').show();
        })

        $('.demoTable .layui-btn').on('click', function(){
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';        //代替另一个对象调用一个方法。call 方法可将一个函数的对象上下文从初始的上下文改变为由 thisObj 指定的新对象。
        });



        var ccuid='';

        form.on('submit(_submson)',function (data) {
            console.log(data.field)
            if($('.zJ strong').text()<=0){
                layer.msg('总金额不能小于0');
                return false;
            }
            var can='';


            $('.danhaos').find('table').each(function (k,v) {
                var Bit;
                var Names;
                var Ins=$(v).find('[name="like1[write]"]');
                if(Ins.is(':checked')){
                    Bit=$(Ins).parents('table').attr('bt_id');
                }
                can+=Bit+','
            })
                can=can.substring(0,can.length-1)
            var zongjia=$('.zJ strong').text();
            zongjia=zongjia.substring(0,zongjia.length-4);
                console.log(can)
            data.field.cc_uuid=sessionStorage.remark;
            data.field.preprice=zongjia;
            data.field.createuser=arrs[0];
            data.field.proce_remark=can;
            data.field.p=getCookie('yanzheng');
            console.log(data.field)
            formAlertAjax('/api/process/addProcessPrice.do',data.field,'.tijiao');


            return false;
        })          //监听提交

        form.on('select(filter)', function(data){
            console.log(data.elem); //得到select原始DOM对象
            console.log(data.value); //得到被选中的值
            console.log(data.othis); //得到美化后的DOM对象
            ccuid=data.value;
            Btnoff('.tijiao');
            $('.dongtab tbody').html('');
            $('.neirong').html('');
            $('.neirong').show();
            $('.beixuan tbody tr').remove();

            sessionStorage.remark=data.value;
            ajaxs('/api/process/buildProcessPriceMana.do','post',{'type':'a','remark':data.value,'p':getCookie('yanzheng')},function (data) {
                console.log(data,'我s    assasd ')

                var datas=data.data;

                var arrs=new Object();
                for(var i=0;i<datas.length;i++){

                    $('.dongtab tbody').append('<tr>' +
                    '                                <td>'+datas[i].cc_cname+'</td>' +
                    '                                <td>'+datas[i].cc_cnum+'</td>' +
                    '                                <td>'+datas[i].cc_cbit+'</td>' +
                    '                            </tr>');

                }

                ajaxs('/api/process/buildProcessPriceMana.do','post',{'type':'b','remark':ccuid,'p':getCookie('yanzheng')},function (data){
                    console.log(data.data,'sadsadasdasdasdasdasdsadas')
                    $('.danhaos').html('');
                    var data1=data.data;
                    var renshou=data1[0].hprice;
                    var kaicao=data1[0].oprice;

                    var dzj=0;
                    var shu=0;



                    if(data1.length!=0){
                        $('._Yin').show();
                    }else{
                        $('._Yin').hide();
                        $('.zJ').hide();
                    }
                    for(i=0;i<data1.length;i++){
                        $('.danhaos').append(' <table class="layui-table " id="table-'+i+'" bt_id="'+data1[i].bt_id+'" >\n' +
                            '                            <thead>\n' +
                            '                                   <tr>\n' +
                            '                                    <th> ' +
                            '                                         <div class="layui-form-item" pane="">\n' +
                            '                                            <div class="layui-input-block">\n' +
                            '                                                <input type="checkbox" name="like1[write]" lay-filter="filter" lay-skin="primary" title=\'\'>\n' +
                            '                                            </div>\n' +
                            '                                        </div>' +
                            '                                   </th>\n' +
                            '                                    <th>名称</th>\n' +
                            '                                    <th>数量</th>\n' +
                            '                                    <th>计量单位</th>\n' +
                            '                                    <th>小计</th>\n' +
                            '\n' +
                            '                                </tr>\n' +
                            '                            </thead>\n' +
                            '                            <tbody>\n' +

                            '                            </tbody>\n' +
                            '                        </table>');
                        dzj=0;
                        for(var j=0;j<data1[i].details.length;j++){
                            var dasj=data1[i].details[j];

                            if(dasj.bt_Name.indexOf('直')==1||dasj.bt_Name.indexOf('梅')==1){
                                jia=(Number(dasj.bt_Value)*kaicao).toFixed(4);
                                dzj+=Number(((dasj.bt_Value)*kaicao).toFixed(4));
                            }else{
                                jia=(Number(dasj.bt_Value)*renshou).toFixed(4);
                                dzj+=Number(((dasj.bt_Value)*renshou).toFixed(4));
                            }
                            $('#table-'+i).append('<tr>\n' +
                    '                                    <td></td>\n' +
                    '                                    <td>'+dasj.bt_Name+'</td>\n' +
                    '                                    <td>'+dasj.bt_Value+'</td>\n' +
                    '                                    <td>'+dasj.bt_bit+'</td>\n' +
                    '                                    <td>'+jia+'万元</td>\n' +
                    '                                </tr>')
                        };
                        console.log(dzj,'sadlaskdaskdkaskdaskdkasdksa')
                        $('#table-'+i).attr('zj',dzj);
                    }


                    form.render();
                    $('.zJ').show();

                })

            })

        });

        $(document).on('click','.zengjia',function () {
            var _htmls=$(this).parent().html();
            console.log(_htmls)
            $(this).parent().before('<div class="zeng">'+_htmls+'</div>');
        })


        $(document).on('click','.shanchu',function () {
            var _htmls=$(this).parent();
            _htmls.remove();
        })

        //前后若干天可选，这里设置不能选过去的日期      最远可选1000天之后
        panduanshijiantow('#test-limit3','#test-limit4',1000,1000,'.layui-btn-normal');     //查询 开始结束时间判断
        panduanshijiantow('#test-limit5','#test-limit6',1000,1000,'.layui-btn-normal');     //查询 开始结束时间判断

        $('.shenqingvisa').click(function () {
            $('.mask').show();
            $('.shenqing').show();
            $('.chakan').hide();
            $('.titleL').html('进度款支付');
            $('[name="bt_id"]').val('');
            $('.dongtab tbody').html('');
            $('.neirong').html('');
            Btnon('.tijiao');

        })

        $('.close').click(function () {     //遮罩层隐藏
            $('.mask').hide();
            $('[name="bt_id"]').val('');
            $('.beixuan tbody tr').remove();
            $('._Yin').hide();
            $('.zJ strong').html(0);
            form.render();
        })
        //监听工具条
        table.on('tool(test)', function(obj){ //注：tool是工具条事件名，test是table原始容器的属性 lay-filter="对应的值"
            var data = obj.data; //获得当前行数据
            var layEvent = obj.event; //获得 lay-event 对应的值
            var tr = obj.tr; //获得当前行 tr 的DOM对象

            if(layEvent === 'detail'){ //查看
                //do somehing
                console.log(obj)
                sessionStorage.objs=JSON.stringify(obj);

                sessionStorage.remark=obj.data.proce_Remark;
                location.href='./gongchengjindukuanSQ.html';
            }
        });
        var zongjia=0;

        function isAllChecked(par) {
            var all = true;

            var money = 0;

            par.find('tr').each(function (k, v) {
                if(!$(v).hasClass('active')){
                    all = false;
                }else{
                    money+= Number($(v).attr('zongjia')).toFixed(4);
                }
            })


            console.log(par.find('tr'), '+++++++++++++++!!!!!!!!!!')

            $('.zJ').find('strong').html(money);

            if(all) {
                $('.beixuan').find('.quanxuan').get(0).checked = true;
                $('.beixuan').find('.quanxuan').parent().find('.layui-unselect').addClass('layui-form-checked');
            }else{
                $('.beixuan').find('.quanxuan').get(0).checked = false;
                $('.beixuan').find('.quanxuan').parent().find('.layui-unselect').removeClass('layui-form-checked');
            }

        }

        function afterChecked(ele) {
            var tr = $(ele).parents('tr');
            tr.toggleClass('active');

            isAllChecked($(tr).parent());
        }


        $(document).on('click','._ingshan',function () {
            console.log($(this).prev().attr('src'))
            var shanSRC=$(this).prev().attr('src');
            $(this).parent().remove();
            $.each(_picurls,function(index,item){       //删除功能
                // index是索引值（即下标）   item是每次遍历得到的值；
                if(item==shanSRC){
                    _picurls.splice(index,1);
                }

            });

            console.log(_picurls)
        })

        form.on('submit(_subm)',function (data) {
            console.log(data.field)

            var cailiao='';

            $.each($('.neirongon'),function (k,v) {
                var names=$(v).children().eq(0).val();
                var Num=$(v).children().eq(1).val();
                var danweis=$(v).children().eq(2).val();
                var duibi=Num=$(v).children().eq(1).attr('panduan');
                if(Num<0){
                    layer.msg('数量不能小于0');
                    $(v).children().eq(1).val(0);
                    return;
                }
                if(Num>duibi){
                    layer.msg('内容不能大于总概况');
                    $(v).children().eq(1).val(0);
                    return;
                }


                cailiao+=(names+','+Num+','+danweis+'|');
            })



            cailiao=cailiao.substring(0,cailiao.length-1);
            console.log(cailiao)
            data.field.cc_uuid=ccuid;
            data.field.str=cailiao;
            data.field.p=getCookie('yanzheng');
            formAlertAjax('/api/process/builPrecessBao.do',data.field,'.tijiao');


            return false;
        })          //监听提交


    })

</script>
</body>
</html>